/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-06 15:05:44  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "WWYT_BP_WORK_SAFETY_APPLY_FIRE")
@SQLDelete(sql = "update WWYT_BP_WORK_SAFETY_APPLY_FIRE set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_BP_WORK_SAFETY_APPLY_FIRE set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class BpWorkSafetyApplyFire implements java.io.Serializable {

    // columns START
    // ID
    private java.lang.Long id;
    // 作业证编号
    private java.lang.String code;
    // 作业类型
    private java.lang.String type;
    // 作业级别
    private java.lang.Integer workLevel;
    // 作业开始时间
    private java.util.Date startTime;
    // 作业结束时间
    private java.util.Date endTime;
    // 申请日期
    private java.util.Date applyTime;
    // 状态
    private java.lang.Integer state;
    // 申请单位
    private java.lang.Long applyDepartId;
    // 申请人
    private java.lang.Long applyUserId;
    // 动火方式
    private java.lang.Long opFireMethod;
    // 动火内容
    private java.lang.String opFireContent;
    // 动火地点
    private java.lang.String opFireLocationCoords;
    // 所属风险区域
    private java.lang.Long riskDistrictId;
    // 生产单位负责人
    private java.lang.Long productionDepartResponsibleUserId;
    // 动火作业负责人
    private java.lang.Long opFireJobResponsibleUserId;
    // 动火初审人
    private java.lang.Long opFireFirstAuditUserId;
    // 监火人
    private java.lang.Long opFireMonitorUserId;
    // 实施安全教育人
    private java.lang.Long opFireEducationUserId;
    // 风险点
    private java.lang.Long riskPointId;
    // 风险级别
    private java.lang.Integer riskLevel;
    // JHA风险评估报告ID
    private java.lang.Long jhaEvaluationId;
    // 附件ID
    private java.lang.Long attachmentId;
    // 危害辨识
    private java.lang.String dangerRecoganize;
    // 编制人
    private java.lang.Long editUserId;
    // 创建人
    private java.lang.Long createBy;
    // 创建时间
    private java.util.Date createTime;
    // 更新人
    private java.lang.Long updateBy;
    // 更新时间
    private java.util.Date updateTime;
    // 删除标记
    private java.lang.String deleteFlag;
    // 组织机构代码
    private java.lang.String orgCode;
    // 租户
    private java.lang.Long tenentId;
    // columns END
    private String auditMsg;

    public void setId(java.lang.Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public java.lang.Long getId() {
        return this.id;
    }

    @Column(name = "CODE", length = 10)
    public java.lang.String getCode() {
        return this.code;
    }

    public void setCode(java.lang.String value) {
        this.code = value;
    }

    @Column(name = "TYPE", length = 4)
    public java.lang.String getType() {
        return this.type;
    }

    public void setType(java.lang.String value) {
        this.type = value;
    }

    @Column(name = "WORK_LEVEL")
    public java.lang.Integer getWorkLevel() {
        return this.workLevel;
    }

    public void setWorkLevel(java.lang.Integer value) {
        this.workLevel = value;
    }

    @Column(name = "START_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public java.util.Date getStartTime() {
        return this.startTime;
    }

    public void setStartTime(java.util.Date value) {
        this.startTime = value;
    }

    @Column(name = "END_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public java.util.Date getEndTime() {
        return this.endTime;
    }

    public void setEndTime(java.util.Date value) {
        this.endTime = value;
    }

    @Column(name = "APPLY_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public java.util.Date getApplyTime() {
        return this.applyTime;
    }

    public void setApplyTime(java.util.Date value) {
        this.applyTime = value;
    }

    @Column(name = "STATE")
    public java.lang.Integer getState() {
        return this.state;
    }

    public void setState(java.lang.Integer value) {
        this.state = value;
    }

    @Column(name = "AUDIT_MSG", length = 200)
    public String getAuditMsg() {
        return auditMsg;
    }

    public void setAuditMsg(String auditMsg) {
        this.auditMsg = auditMsg;
    }

    @Column(name = "APPLY_DEPART_ID")
    public java.lang.Long getApplyDepartId() {
        return this.applyDepartId;
    }

    public void setApplyDepartId(java.lang.Long value) {
        this.applyDepartId = value;
    }

    @Column(name = "APPLY_USER_ID")
    public java.lang.Long getApplyUserId() {
        return this.applyUserId;
    }

    public void setApplyUserId(java.lang.Long value) {
        this.applyUserId = value;
    }

    @Column(name = "OP_FIRE_METHOD")
    public java.lang.Long getOpFireMethod() {
        return this.opFireMethod;
    }

    public void setOpFireMethod(java.lang.Long value) {
        this.opFireMethod = value;
    }

    @Column(name = "OP_FIRE_CONTENT", length = 200)
    public java.lang.String getOpFireContent() {
        return this.opFireContent;
    }

    public void setOpFireContent(java.lang.String value) {
        this.opFireContent = value;
    }

    @Column(name = "OP_FIRE_LOCATION_COORDS", length = 4000)
    public java.lang.String getOpFireLocationCoords() {
        return this.opFireLocationCoords;
    }

    public void setOpFireLocationCoords(java.lang.String value) {
        this.opFireLocationCoords = value;
    }

    @Column(name = "RISK_DISTRICT_ID")
    public java.lang.Long getRiskDistrictId() {
        return this.riskDistrictId;
    }

    public void setRiskDistrictId(java.lang.Long value) {
        this.riskDistrictId = value;
    }

    @Column(name = "PRODUCTION_DEPART_RESPONSIBLE_USER_ID")
    public java.lang.Long getProductionDepartResponsibleUserId() {
        return this.productionDepartResponsibleUserId;
    }

    public void setProductionDepartResponsibleUserId(java.lang.Long value) {
        this.productionDepartResponsibleUserId = value;
    }

    @Column(name = "OP_FIRE_JOB_RESPONSIBLE_USER_ID")
    public java.lang.Long getOpFireJobResponsibleUserId() {
        return this.opFireJobResponsibleUserId;
    }

    public void setOpFireJobResponsibleUserId(java.lang.Long value) {
        this.opFireJobResponsibleUserId = value;
    }

    @Column(name = "OP_FIRE_FIRST_AUDIT_USER_ID")
    public java.lang.Long getOpFireFirstAuditUserId() {
        return this.opFireFirstAuditUserId;
    }

    public void setOpFireFirstAuditUserId(java.lang.Long value) {
        this.opFireFirstAuditUserId = value;
    }

    @Column(name = "OP_FIRE_MONITOR_USER_ID")
    public java.lang.Long getOpFireMonitorUserId() {
        return this.opFireMonitorUserId;
    }

    public void setOpFireMonitorUserId(java.lang.Long value) {
        this.opFireMonitorUserId = value;
    }

    @Column(name = "OP_FIRE_EDUCATION_USER_ID")
    public java.lang.Long getOpFireEducationUserId() {
        return this.opFireEducationUserId;
    }

    public void setOpFireEducationUserId(java.lang.Long value) {
        this.opFireEducationUserId = value;
    }

    @Column(name = "RISK_POINT_ID")
    public java.lang.Long getRiskPointId() {
        return this.riskPointId;
    }

    public void setRiskPointId(java.lang.Long value) {
        this.riskPointId = value;
    }

    @Column(name = "RISK_LEVEL")
    public java.lang.Integer getRiskLevel() {
        return this.riskLevel;
    }

    public void setRiskLevel(java.lang.Integer value) {
        this.riskLevel = value;
    }

    @Column(name = "JHA_EVALUATION_ID")
    public java.lang.Long getJhaEvaluationId() {
        return this.jhaEvaluationId;
    }

    public void setJhaEvaluationId(java.lang.Long value) {
        this.jhaEvaluationId = value;
    }

    @Column(name = "ATTACHMENT_ID")
    public java.lang.Long getAttachmentId() {
        return this.attachmentId;
    }

    public void setAttachmentId(java.lang.Long value) {
        this.attachmentId = value;
    }

    @Column(name = "DANGER_RECOGANIZE", length = 1000)
    public java.lang.String getDangerRecoganize() {
        return this.dangerRecoganize;
    }

    public void setDangerRecoganize(java.lang.String value) {
        this.dangerRecoganize = value;
    }

    @Column(name = "EDIT_USER_ID")
    public java.lang.Long getEditUserId() {
        return this.editUserId;
    }

    public void setEditUserId(java.lang.Long value) {
        this.editUserId = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public java.lang.Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(java.lang.Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public java.lang.Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(java.lang.Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public java.lang.String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(java.lang.String value) {
        this.deleteFlag = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public java.lang.String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(java.lang.String value) {
        this.orgCode = value;
    }

    @Column(name = "TENENT_ID")
    public java.lang.Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(java.lang.Long value) {
        this.tenentId = value;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("code", getCode())
                .append("type", getType()).append("workLevel", getWorkLevel()).append("startTime", getStartTime())
                .append("endTime", getEndTime()).append("applyTime", getApplyTime()).append("state", getState())
                .append("applyDepartId", getApplyDepartId()).append("applyUserId", getApplyUserId())
                .append("opFireMethod", getOpFireMethod()).append("opFireContent", getOpFireContent())
                .append("opFireLocationCoords", getOpFireLocationCoords()).append("riskDistrictId", getRiskDistrictId())
                .append("productionDepartResponsibleUserId", getProductionDepartResponsibleUserId())
                .append("opFireJobResponsibleUserId", getOpFireJobResponsibleUserId())
                .append("opFireFirstAuditUserId", getOpFireFirstAuditUserId())
                .append("opFireMonitorUserId", getOpFireMonitorUserId())
                .append("opFireEducationUserId", getOpFireEducationUserId()).append("riskPointId", getRiskPointId())
                .append("riskLevel", getRiskLevel()).append("jhaEvaluationId", getJhaEvaluationId())
                .append("attachmentId", getAttachmentId()).append("dangerRecoganize", getDangerRecoganize())
                .append("editUserId", getEditUserId()).append("createBy", getCreateBy())
                .append("createTime", getCreateTime()).append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime()).append("deleteFlag", getDeleteFlag())
                .append("orgCode", getOrgCode()).append("tenentId", getTenentId()).toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpWorkSafetyApplyFire == false)
            return false;
        if (this == obj)
            return true;
        BpWorkSafetyApplyFire other = (BpWorkSafetyApplyFire) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
